<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="java.sql.*" %>
<%@ page  import="web.*" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'result.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body>
   <%
   String name1=request.getParameter("zhanghao");
   String word1=request.getParameter("mima");
   int i=0;
   int j=0;
   String sql="select user.zhanghao,user.mima,user.mibao from user";
   List<Map<String,Object>> list=new ArrayList<Map<String,Object>>();
   Map<String,Object> map1=new HashMap<String,Object>();
   jdbc my1=new jdbc();
   list=my1.select(sql);
   while(i<list.size()){
	   map1=list.get(i);
	   i++;
	   String pwd=(String)map1.get("mima");
	   if(pwd.equals(word1)){
		   j++;
		   %>
		   <script type="text/javascript">
		   window.self.location="result4.jsp";
		   </script>
		   <% 
	   }
   }
   if(j==0){
	   out.println("账号或密码错误");
   }
   %>
  </body>
</html>
